Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Robot Framework files with robotidy #263

Merged
merged 2 commits into from
Nov 28, 2023

Conversation

scop
Copy link
Contributor

@scop scop commented Nov 26, 2023

No description provided.

@@ -136,6 +136,9 @@
"--parser=yaml"
(apheleia-formatters-js-indent "--use-tabs" "--tab-width")))
(purs-tidy . ("apheleia-npx" "purs-tidy" "format"))
(robotidy . ("robotidy" "--no-color" inplace
Copy link
Contributor Author

@scop scop Nov 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this triggers a bug somewhere, test suite or inplace implementation, or my understanding of it?

Debugger entered--Lisp error: (error "Formatter robotidy modified original file in place")

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ouch. This is probably a bug. It's the first time we've had a formatter actually use inplace 🙃. Could you open a new issue for this?

In the meantime I took a look at robotidy and it supports formatting to stdout. Generally this is the better choice because it side-steps the filesystem for subprocess io. You can change inplace to "-" and it should work.

Copy link
Contributor Author

@scop scop Nov 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opened #265 for the test suite issue.

Re stdout, nice catch! I couldn't find anything related to that in the docs, but now I see https://robotidy.readthedocs.io/en/stable/quickstart.html#transform-code-from-standard-input (that refers to stdin only though...). Anyway it seems to work indeed.

@@ -136,6 +136,9 @@
"--parser=yaml"
(apheleia-formatters-js-indent "--use-tabs" "--tab-width")))
(purs-tidy . ("apheleia-npx" "purs-tidy" "format"))
(robotidy . ("robotidy" "--no-color" inplace
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ouch. This is probably a bug. It's the first time we've had a formatter actually use inplace 🙃. Could you open a new issue for this?

In the meantime I took a look at robotidy and it supports formatting to stdout. Generally this is the better choice because it side-steps the filesystem for subprocess io. You can change inplace to "-" and it should work.

CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Contributor

@mohkale mohkale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks.

@mohkale mohkale merged commit 5665172 into radian-software:main Nov 28, 2023
4 checks passed
@scop scop deleted the feat/robotidy branch November 29, 2023 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants